/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package poker;

import java.awt.Color;
import java.awt.Font;
import java.awt.Graphics;
import java.util.Vector;

/**
 *
 * @author pol
 */
public class AreaDibujoGanaSesion extends AreaDibujo {
    private Vector<String> jug;
    private String din;
    private Ventana ven;

    public AreaDibujoGanaSesion(Vector<String> jug, String din, Ventana ven) {
        this.jug = jug;
        this.din = din;
        this.ven = ven;
        repaint();
    }

    @Override
    public void clickRecibido(int x, int y) {
        if (x >= 180 && x <= 180 + 250 && y >= 430 && y <= 430 + 30)
            ven.finalizarGanaSesion();
        repaint();
    }

    @Override
    public void paint(Graphics g) {
        pintaFondo(g);
        g.setColor(new Color(255, 255, 0));
        g.setFont(new Font(null, Font.BOLD, 20));
        if (jug.size() == 1) {
            g.drawString("El ganador de la sesión es: " + jug.get(0), 70, 100);
        }
        else {
            g.drawString("Los ganadores de la sesión son:", 70, 100);
            for (int i = 0; i < jug.size(); ++i) {
                g.drawString(jug.get(i), 80, 140 + 40*i);
            }
        }
        g.setColor(new Color(0, 64, 0));
        g.fillRect(180, 430, 250, 30);
        g.setColor(new Color(255, 255, 0));
        g.setFont(new Font(null, Font.BOLD, 15));
        g.drawString("ACEPTAR", 250, 450);
    }
}
